@extends('admin_system.layout.layout')
@section('content')

    <div class="container-fluid">
        <div class="list-group">
            <a href="#" class="list-group-item active">
                <h4 class="list-group-item-heading">学习官中心</h4>
                <p class="list-group-item-text">编辑通知列表</p>
            </a>
        </div>

        <div class="panel panel-danger">
            <div class="panel-heading">
                <h3 class="panel-title text-center">学习官中心</h3>
            </div>

            <div class="panel-body">
                <form action="{{route('notice_update',['id'=>$notice->id])}}" method="post" enctype="multipart/form-data">
                    {{csrf_field()}}
                    <div class="form-group">
                        <label for="type" class="control-label">通知的类型:</label>
                        <div class="">

                            <select name="type" id="type" class="form-control">

                                <option value="2" @if($notice->type=='文章') selected @endif>文章</option>

                                <option value="1" @if($notice->type=='视频') selected @endif>视频</option>
                            </select>

                        </div>
                    </div>

                    <div class="form-group">
                        <label for="title" class="control-label">通知的标题:</label>
                        <div class="">
                            <input type="text" name="title" id="title" class="form-control" value="{{$notice->title}}"
                                   required="required">
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="notice_id" class="control-label">通知的对应的文章或者视频:</label>
                        <div class="">
                            <select name="notice_id" id="notice_id" class="form-control">
                                <option value="">文章</option>
                                @foreach($article as $k=>$v)
                                    <option value="{{$v->id}}" @if($notice->type=='文章' && $notice->notice_id==$v->id) selected @endif>
                                        &nbsp;&nbsp;&nbsp;&nbsp;└──&nbsp;{{str_limit($v->title,20)}}</option>
                                @endforeach
                                <option value="">视频</option>
                                @foreach($video as $k=>$v)
                                    <option value="{{$v->id}}" @if($notice->type=='视频' && $notice->notice_id==$v->id) selected @endif>
                                        &nbsp;&nbsp;&nbsp;&nbsp;└──&nbsp;{{str_limit($v->title,20)}}</option>
                                @endforeach
                            </select>
                        </div>
                    </div>

                    <div class="btn-group col-md-12" style="padding: 0">
                        <button type="submit" class="btn btn-info" style="width: 100%">保存</button>
                    </div>
                </form>
            </div>
        </div>
    </div>



@stop